


import os
from utils import dump_net
import tensorflow as tf

#logs_train_dir = "../pretrained/mobilenet_v2_1.4_224/mobilenet_v2_1.4_224"
logs_train_dir = "../train/mobilenet_v2_1.4_224.ckpt-29"

sess = tf.Session()
saver = tf.train.Saver()
if os.path.exists(logs_train_dir):
    ckpt = tf.train.get_checkpoint_state(logs_train_dir)
    print("loading {}".format(ckpt.model_checkpoint_path))
    saver.restore(sess, os.path.join(ckpt.model_checkpoint_path))
    restore_step = int(ckpt.model_checkpoint_path.split('/')[-1].split('-')[-1])

    sess.run(tf.global_variables_initializer())
    variable_names = [ v.name for v in tf.trainable_variables() ]
    values = sess.run(variable_names)
    for k,v in zip(variable_names,values):
        print("Variable: ",k)
        print("Shape: ",v.shape)
        print(v)

    # variable_names = [v.name for v in tf.trainable_variables()]
    # values = sess.run(variable_names)
    # for k, v in zip(variable_names, values):
    #     print("Variable: ", k)
    #     print("Shape: ", v.shape)
    #     print(v)
else:
    print(" no train module path exists")




